<div class="container" >
    <div class="row">
        <div class="col-md-12 col-xs-12">
            <h1>Dashboard  <a href="new_reservation" class="btn btn-info pull-right">new reservation</a></h1>
            <?php if(empty($reservation)): ?>
            <p>no reservation Yet</p>
            <?php else: ?>

            <table class="table">
                <thead>
                <th>invitation_code</th>
                <th>day</th>
                <th>status</th>
                <th>created_at</th>
                <th>action</th>
                </thead>
                <tbody>
                <?php foreach ($reservation as $item){ ?>
                <tr>
                    <td><?php echo $item['invitation_code'] ?></td>
                    <td><?php echo $item['day'] ?></td>
                    <td><?php echo $item['status'] ?></td>
                    <td><?php echo $item['created_at'] ?></td>
                    <td>
                        <?php if($item['status'] != 'Verified'): ?>
                        <a class="btn btn-info btn-sm" href="cancel?id=<?php echo $item['id'] ?>"> Cancel</a>
                        <?php endif; ?>
                    </td>
                </tr>
                <?php } ?>
                </tbody>
            </table>
            <?php endif; ?>
        </div>
    </div>
</div>

<script>
    function Cancel(id) {
        if(confirm('confirm Cancel？')){
            location.href = 'cancel?action=del&id='+id;
        }
    }
</script>
